<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminCharityFundTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_charity_fund', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('admin_id')->comment('发布者');
            $table->integer('group_id')->comment('团队ID');
            $table->integer('user_id')->comment('负责人ID');
            $table->string('title')->default('')->comment('标题');
            $table->string('description')->default('')->comment('简介');
            $table->integer('charity_fund_type')->comment('基金类型');
            $table->integer('use_type')->comment('使用方式');
            $table->dateTime('start_time')->comment('起始时间');
            $table->dateTime('end_time')->comment('起始时间');
            $table->string('address')->default('')->comment('地址');
            $table->string('longitude')->default('')->comment('经度');
            $table->string('latitude')->default('')->comment('纬度');
            $table->decimal('target_amount')->comment('目标金额');
            $table->string('personal_donation_amount')->default('20,50,100')->comment('个人捐款金额');
            $table->string('corporate_donation_amount')->default('20,50,100')->comment('企业捐款金额');
            $table->string('random_donation_amount')->default('0')->nullable()->comment('随缘捐金额 0为关闭');
            $table->string('cover_path')->default('')->comment('封面');
            $table->text('content')->comment('内容');
            $table->string('fund_code')->default('0')->nullable()->comment('基金编号');
            $table->tinyInteger('online_status')->default('0')->nullable()->comment('上线状态 0未上线 1已上线');
            $table->tinyInteger('audit_status')->default('0')->nullable()->comment('审核状态 0未审核  1已审核通过 2审核驳回');
            $table->string('audit_response')->nullable()->comment('审核驳回原因');
            $table->json('administrative_committee')->nullable()->comment('管委会成员');
            $table->tinyInteger('donation_type')->default('0')->nullable()->comment('募捐设置 0 公开募捐 1非公开募捐');
            $table->tinyInteger('donate_together')->default('1')->nullable()->comment('一起捐 0禁止 1允许');
            $table->string('registration_number')->nullable()->comment('备案号');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_charity_fund');
    }
}
